<%@LANGUAGE="VBSCRIPT"%>
<!-- #include file="adovbs.inc" -->
<!--#include file="functions.asp" -->
<% 
InvNum 		= request.querystring("InvNum") 
InvStatus	= request.querystring("InvStatus")
dsort		= request.querystring("dsort") 
dorder		= request.querystring("dorder") 
RefOrder	= request.querystring("refOrder") 
VendorID	= request.querystring("VendorID") 
CurSymbol	= request.querystring("CurSymbol")
RecDate		= request.querystring("RecDate") 
RecDate2	= request.querystring("RecDate2")
RptCond		= request.querystring("RptCond")


dim tmpSQL
   if (request.querystring("InvNum") <> "") then
   tmpSQL=" AND INVNUM LIKE '%"& request.querystring("InvNum") & "%'"
   end if
   
   if (request.querystring("InvStatus") <> "0") then
   tmpSQL= tmpSQL & " AND INVSTATUS='"& request.querystring("InvStatus") & "'"
   else
'   tmpSQL= tmpSQL & " AND (INVSTATUS<>'PARKED' AND INVSTATUS<>'ROUTED') " 
   end if
   
   if (request.querystring("CurSymbol") <> "N") then
   tmpSQL= tmpSQL & " AND CURRENCYSYMBOL='"& request.querystring("CurSymbol") & "'"
   end if   
      
   if (request.querystring("VendorID") <> "") then
   tmpSQL= tmpSQL & " AND VENDORID='"& request.querystring("VendorID") & "'"
   end if
   
   if (request.querystring("RefOrder") <> "0") then
   tmpSQL= tmpSQL & " AND REFORDER='"& request.querystring("RefOrder") & "'"
   end if
   
   if (Request.QueryString("RecDate") <> "") Then
   Select Case Request.QueryString("RptCond")
    Case 1
     tmpSQL = tmpSQL & " AND CONVERT(CHAR(10),INVRECDATE,101) = '" & Request.QueryString("RecDate") & "'"
	Case 2
	 tmpSQL = tmpSQL & " AND INVRECDATE <= CONVERT(DATETIME,'" & Request.QueryString("RecDate") & "',101)"
	Case 3
	 tmpSQL = tmpSQL & " AND INVRECDATE >= CONVERT(DATETIME,'" & Request.QueryString("RecDate") & "',101)"
	Case 4
	 tmpSQL = tmpSQL & " AND INVRECDATE BETWEEN '" & Request.QueryString("RecDate") & "' AND '" & Request.QueryString("RecDate2") & "'"
   End Select
   End If


   
   dim tmpSort
   tmpSort="UPDATESTAMP"
   if (request.querystring("dSort") <> "") then
   tmpSort= request.querystring("dSort")
   end if
   
   dim tmpOrder
   tmpOrder = "ASC"
   if (request.QueryString("dOrder") <>"") then
   tmpOrder= request.QueryString("dOrder")
   end if
   Dim CurrOrder
   if (tmpOrder = "ASC" )then 
   CurrOrder ="DESC"
   else
   CurrOrder="ASC"
   end if

%>
<%
dim sql

'-------------------- BEGIN RUNTIME CODE for record navigation
' Declare our vars
Dim iPageSize       'How big our pages are
Dim iPageCount      'The number of pages we get back
dim total_records
Dim iPageCurrent    'The page we want to show
Dim strOrderBy      'A fake parameter used to illustrate passing them
Dim iRecordsShown   'Loop controller for displaying just iPageSize records
Dim I               'Standard looping var

' Get parameters
iPageSize = 20 ' You could easily allow users to change this

' Retrieve page to show or default to 1
If Request.QueryString("page") = "" Then
	iPageCurrent = 1
	total_records=0
Else
	iPageCurrent = CInt(Request.QueryString("page"))
End If

' If you're doing this script with a search or something
' you'll need to pass the sql from page to page.  I'm just
' paging through the entire table so I just hard coded it.

' Create recordset and set the page size		
if (isUC="Y") then
sql = "SELECT SEQNUM, REGNUM, INVNUM, PONUM, VENDORID, PAYMENTDATE, INVSTATUS, INVAMOUNT, CURRENCYSYMBOL, "
sql = sql & "INVRECDATE, INVDUEDATE,  (SELECT TOP 1  VENDOR.NAME FROM VENDOR WHERE VENDOR.VENDORID=EXIREG.VENDORID) AS VENDORNAME, "
sql = sql & "ISOPEN, UPDATESTAMP,REFERENCEDOC,USERDEPT  FROM dbo.EXIREG  WHERE  (USERCOORD='" & empCode 
sql = sql & "' OR USERDEPT='" & Dept & "')  " & tmpSQL & " ORDER BY "  & tmpSort & " " & tmpOrder 
else
sql = "SELECT SEQNUM, REGNUM, INVNUM, PONUM, VENDORID, PAYMENTDATE, INVSTATUS, INVAMOUNT, CURRENCYSYMBOL, INVRECDATE, INVDUEDATE,  "
sql = sql & "(SELECT TOP 1  VENDOR.NAME FROM VENDOR WHERE VENDOR.VENDORID=EXIREG.VENDORID) AS VENDORNAME, ISOPEN, "
sql = sql & "UPDATESTAMP,REFERENCEDOC,USERDEPT  FROM dbo.EXIREG  WHERE (VERIFIEDBY='" & empCode 
sql = sql & "' OR APPROVEDBY='" & empCode &"' OR APPROVED2BY='" & empCode & "' OR AUTHORISEDBY='" & empCode & "' OR SEQNUM IN  " 
sql = sql & "(SELECT DISTINCT INVSEQNUM FROM EXIVERIFY WHERE VERIFIEDBY='" & empcode & "' AND VERIFYSTATUS='VERIFIED') "
sql = sql & " ) " & tmpSQL & " ORDER BY "  & tmpSort & " " & tmpOrder
end if


set EXIREG=Server.CreateObject("ADODB.Recordset")

EXIREG.PageSize = iPageSize

' You can change other settings as with any RS
'objPagingRS.CursorLocation = adUseClient
EXIREG.CacheSize = iPageSize

' Open RS
EXIREG.Open sql, cn, adOpenStatic, adLockReadOnly, adCmdText

' Get the count of the pages using the given page size
iPageCount = EXIREG.PageCount

' If the request page falls outside the acceptable range,
' give them the closest match (1 or max)
If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
If iPageCurrent < 1 Then iPageCurrent = 1

' Check page count to prevent bombing when zero results are returned!


%>
<SCRIPT Language="JavaScript">
var InvNum='<%= request.querystring("InvNum") %>';
var InvStatus='<%= request.querystring("InvStatus") %>';
var dsort='<%= request.querystring("dsort") %>';
var dorder='<%= request.querystring("dorder") %>';
var RefOrder='<%= request.querystring("refOrder") %>';
var VendorID='<%= request.querystring("VendorID") %>';
var CurSymbol='<%= request.querystring("CurSymbol") %>';
var RecDate='<%= request.querystring("RecDate") %>';
var RecDate2='<%= request.querystring("RecDate2") %>';
var RptCond='<%= request.querystring("RptCond") %>';

function DocLoad(){

}


<!--
function DoSort(dtsort,dtorder) {
//alert (link.id);
//location = link.href;
document.form1.dsort.value=dtsort;
document.form1.dorder.value=dtorder;
document.form1.submit();
return false;
}
// -->
function redirect(which){
location='My_InvoiceDet.asp?seqnum='+which+'&InvNum='+InvNum+'&InvStatus='+InvStatus+'&dsort='+ dsort+'&dorder='+ dorder+'&RefOrder='+RefOrder+'&VendorID='+VendorID+'&CurSymbol='+CurSymbol+'&RecDate='+RecDate+'&RecDate2='+RecDate2+'&RptCond='+RptCond;
return false
}

function register(){
location='Inv_Register.asp?InvStatus='+InvStatus+'&dsort='+ dsort+'&dorder='+ dorder+'&RefOrder='+RefOrder+'&VendorID='+VendorID+'&CurSymbol='+CurSymbol+'&RecDate='+RecDate+'&RecDate2='+RecDate2+'&RptCond='+RptCond;
return false
}

function doClear(){
location='My_Invoice_List.asp?InvStatus=0&RefOrder=0&CurSymbol=N';
return false
}

function doSearch(){
location='My_InvSearch.asp?InvNum='+InvNum+'&InvStatus='+InvStatus+'&dsort='+ dsort+'&dorder='+ dorder+'&RefOrder='+RefOrder+'&VendorID='+VendorID+'&CurSymbol='+CurSymbol+'&RecDate='+RecDate+'&RecDate2='+RecDate2+'&RptCond='+RptCond;
return false
}
</SCRIPT>
<!-- #include file="pagetop_usr.asp" -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td nowrap height="21" bgcolor="#FFFFFF" width="3%" background="images/menu_end.gif">&nbsp;</td>
    <td nowrap height="21" bgcolor="#FFFFFF" width="28"> 
      <div align="center"><img src="images/menu_awal_off.gif" width="28" height="33"></div>
    </td>
    <td width="15%" background="images/menuoff.gif" height="21" nowrap> 
      <div align="center"><b><a href="My_invoice.asp" class="menu">My Invoice</a></b></div>
    </td>
    <td height="21" bgcolor="#FFFFFF" width="11"><img src="images/menu_off_on_separator.gif" width="28" height="33"></td>
    <td height="21" bgcolor="#FFFFFF" width="15%" background="images/menuon.gif"> 
      <div align="center" class="menu">My Invoice Archive</div>
    </td>
    <td height="21" bgcolor="#FFFFFF" width="11"><img src="images/Menu_onend.gif" width="13" height="33"></td>
    <td height="21" bgcolor="#FFFFFF" background="images/menu_end.gif">
<% if isManager = "Y" then %>      
      <div align="right"><a href="Outstanding_Dept.asp" style="color:Red;font-weight:bold;">Outstanding Invoices</a>&nbsp;&nbsp;&nbsp;</div>
<% end if %>	  
    </td>
  </tr>
  <tr bgcolor="#93bee2"> 
    <td width="3%" bgcolor="#93bee2">&nbsp;</td>
    <td width="28" bgcolor="#93bee2">&nbsp;</td>
    <td width="10%" bgcolor="#93bee2">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#93bee2">
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td> 
      <form name="form1" method="post" action="My_invoice_xls.asp" target="_blank">
        <input type="radio" name="radiobutton" value="radiobutton" checked>
        Invoices With Reference Order 
        <input type="radio" name="radiobutton" value="radiobutton" onClick="window.location='my_invLVO_List.asp?InvStatus=0&RefOrder=0&CurSymbol=N'">
        LVO Invoices &nbsp; 
        <input type="button" name="Button" value="Search..." class="sbttn" onClick="doSearch()">
        <input type="button" name="Submit2" value="Clear Search..." class="sbttn" onClick="doClear()">
        <input type="submit" name="Submit" value="Export To Excel" class="sbttn">
        <input type="hidden" name="InvNum" value="<%= request.querystring("InvNum") %>">
        <input type="hidden" name="InvStatus" value="<%= request.querystring("InvStatus") %>">
        <input type="hidden" name="RefOrder" value="<%= request.querystring("RefOrder") %>">
        <input type="hidden" name="VendorID" value="<%= request.querystring("VendorID") %>">
        <input type="hidden" name="CurSymbol" value="<%= request.querystring("CurSymbol") %>">
        <input type="hidden" name="dsort" value="<%= Request.querystring("dsort") %>">
        <input type="hidden" name="dorder" value="<%= Request.querystring("dorder") %>">
        &nbsp; 
        <input type="hidden" name="RecDate" value="<%= request.querystring("RecDate") %>">
        <input type="hidden" name="RecDate2" value="<%= request.querystring("RecDate2") %>">
        <input type="hidden" name="RptCond" value="<%= request.querystring("RptCond") %>">
        <input type="hidden" name="dept">
      </form>    </td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td> 
      <table border="0" width="70%" cellpadding="0" cellspacing="0">
        <tr valign="middle"> 
          <td width="23%" align="center" height="24"> <font color="#CC0000"><b > 
            <% If iPageCurrent <> 1 Then %>
            <a href="My_invoice_list.asp?page=<%= 1 %>&dorder=<%= dOrder %>&dsort=<%= dsort%>&invstatus=<%= invstatus %>&InvNum=<%= invnum %>&RefOrder=<%= reforder %>&recdate=<%=recdate %>&rptcond=<%= rptcond %>&vendorid=<%= vendorid %>&Cursymbol=<%= cursymbol %>">&lt;&lt; 
            First</a> 
            <% End If%>
            </b></font></td>
          <td width="31%" align="center" height="24"> <font color="#CC0000"><b> 
            <% If iPageCurrent <> 1 Then %>
            <a href="My_invoice_list.asp?page=<%= iPageCurrent-1 %>&dorder=<%= dOrder %>&dsort=<%= dsort%>&invstatus=<%= invstatus %>&InvNum=<%= invnum %>&RefOrder=<%= reforder %>&recdate=<%=recdate %>&rptcond=<%= rptcond %>&vendorid=<%= vendorid %>&Cursymbol=<%= cursymbol %>">&lt; 
            Previous</a> 
            <% End If %>
            </b></font></td>
          <td width="23%" align="center" height="24"> <font color="#CC0000"><b> 
            <% If iPageCurrent<iPageCount Then %>
            <a href="My_invoice_list.asp?page=<%= iPageCurrent+1 %>&dorder=<%= dOrder %>&dsort=<%= dsort%>&invstatus=<%= invstatus %>&InvNum=<%= invnum %>&RefOrder=<%= reforder %>&recdate=<%=recdate %>&rptcond=<%= rptcond %>&vendorid=<%= vendorid %>&Cursymbol=<%= cursymbol %>">Next 
            &gt; </a> 
            <% End If %>
            </b></font></td>
          <td width="23%" align="center" height="24"> <font color="#CC0000"><b> 
            <% If iPageCurrent<iPageCount Then %>
            <a href="My_invoice_list.asp?page=<%= iPageCount %>&dorder=<%= dOrder %>&dsort=<%= dsort%>&invstatus=<%= invstatus %>&InvNum=<%= invnum %>&RefOrder=<%= reforder %>&recdate=<%=recdate %>&rptcond=<%= rptcond %>&vendorid=<%= vendorid %>&Cursymbol=<%= cursymbol %>">Last 
            &gt;&gt; </a> 
            <% End If %>
            </b></font></td>
        </tr>
      </table>    </td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF"><img src="images/curv_data.gif" width="21" height="21"></td>
    <td bgcolor="#FFFFFF"><b>Invoices</b></td>
  </tr>
  <tr> 
    <td width="4%" height="21">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF" height="21">&nbsp;</td>
    <td bgcolor="#FFFFFF" height="21"> 
      <%
	If iPageCount = 0 Then
	Response.Write "<h3>No records found!</h3>"
Else
	' Move to the selected page
	EXIREG.AbsolutePage = iPageCurrent
    total_records=iPageSize*(iPageCurrent-1)
    total_records_abs=iPageSize*iPageCurrent
    record_cnt=EXIREG.recordcount

    dim Incr
    dim InvStatus
    Incr = 1
	%>
      Records <%= Incr + Total_records %> to 
	  <%
	  if Total_records_abs > record_cnt then 
	    response.Write(record_cnt)
	  else
	    response.Write(Total_records_abs)
	  end if	
	  %> of <%= record_cnt %></td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF"> 
      <table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#999999">
        <tr bgcolor="#D1DDEF" valign="middle"> 
          <td width="5%" height="24"> 
            <div align="center"><font color="#000000"><b><font color="#000066">No.</font></b></font></div>          </td>
          <td width="9%" height="24" bgcolor="#D1DDEF"> 
            <div align="center"><font color="#000066"><b><a href="My_invoice_List.asp?dsort=REGNUM&amp;&amp;invnum=<%= tmpinvnum %>&amp;vendorid=<%= tmpvendorid %>&amp;recdate=<%= tmprecdate %>&amp;recdate2=<%= tmprecdate2 %>&amp;rptcond=<%= tmprptcond %>&amp;invstatus=<%= invstatus %>&amp;reforder=<%= reforder %>&amp;cursymbol=<%= cursymbol %>" class="menu">Reg. 
              No</a> 
              <% if (tmpSort="REGNUM") then %>
              <img src="images/imgSort<%= tmpOrder %>.gif" width="10" height="15"> 
              <% end if %>
              </b></font></div>          </td>
          <td width="5%" bgcolor="#D1DDEF">            <div align="center"><font color="#000066"><b><a href="My_invoice_List.asp?dsort=USERDEPT&amp;&amp;invnum=<%= tmpinvnum %>&amp;vendorid=<%= tmpvendorid %>&amp;recdate=<%= tmprecdate %>&amp;recdate2=<%= tmprecdate2 %>&amp;rptcond=<%= tmprptcond %>&amp;invstatus=<%= invstatus %>&amp;reforder=<%= reforder %>&amp;cursymbol=<%= cursymbol %>" class="menu">Dept</a> 
              <% if (tmpSort="INVAMOUNT") then %>
              <img src="images/imgSort<%= tmpOrder %>.gif" width="10" height="15"> 
              <% end if %>
              </b></font><font color="#000000"></font></div>          </td>
          <td width="13%" height="24" bgcolor="#D1DDEF"> 
            <div align="center"><font color="#000066"><b>Invoice No.</b></font></div>          </td>
          <td width="11%" height="24"> 
            <div align="center"><font color="#000066"><b>Ref.Order</b></font></div>          </td>
          <td width="11%" height="24"> 
            <div align="center"><font color="#000066"><b>Payment Date </b></font></div>          </td>
          <td width="4%" height="24"> 
            <div align="center"><font color="#000066"><b>Curr.</b></font></div>          </td>
          <td width="10%" height="24"> 
            <div align="center"><font color="#000066"><b><a href="My_invoice_List.asp?dsort=INVAMOUNT&amp;&amp;invnum=<%= tmpinvnum %>&amp;vendorid=<%= tmpvendorid %>&amp;recdate=<%= tmprecdate %>&amp;recdate2=<%= tmprecdate2 %>&amp;rptcond=<%= tmprptcond %>&amp;invstatus=<%= invstatus %>&amp;reforder=<%= reforder %>&amp;cursymbol=<%= cursymbol %>" class="menu">Amount</a> 
              <% if (tmpSort="INVAMOUNT") then %>
              <img src="images/imgSort<%= tmpOrder %>.gif" width="10" height="15"> 
              <% end if %>
              </b></font><font color="#000000"></font></div>          </td>
          <td height="24"> 
            <div align="center"><font color="#000000"><b><a href="My_invoice_List.asp?dsort=VENDORID&amp;&amp;invnum=<%= tmpinvnum %>&amp;vendorid=<%= tmpvendorid %>&amp;recdate=<%= tmprecdate %>&amp;recdate2=<%= tmprecdate2 %>&amp;rptcond=<%= tmprptcond %>&amp;invstatus=<%= invstatus %>&amp;reforder=<%= reforder %>&amp;cursymbol=<%= cursymbol %>" class="menu">Vendor</a></b></font><font color="#000066"><b> 
              <% if (tmpSort="VENDORID") then %>
              <img src="images/imgSort<%= tmpOrder %>.gif" width="10" height="15"> 
              <% end if %>
              </b></font></div>          </td>
          <td width="8%" height="24"> 
            <div align="center"><font color="#000000"><b><a href="My_invoice_List.asp?dsort=INVSTATUS&amp;&amp;invnum=<%= tmpinvnum %>&amp;vendorid=<%= tmpvendorid %>&amp;recdate=<%= tmprecdate %>&amp;recdate2=<%= tmprecdate2 %>&amp;rptcond=<%= tmprptcond %>&amp;invstatus=<%= invstatus %>&amp;reforder=<%= reforder %>&amp;cursymbol=<%= cursymbol %>" class="menu">Status</a></b></font><font color="#000066"><b> 
              <% if (tmpSort="INVSTATUS") then %>
              <img src="images/imgSort<%= tmpOrder %>.gif" width="10" height="15"> 
              <% end if %>
              </b></font></div>                     
</td>
        </tr>
        <% iRecordsShown=0
		   do while NOT EXIREG.EOF and (iRecordsShown <iPageSize)
%>
        <% if ((Incr mod 2 ) <> 0 ) Then %>
        <tr bgcolor="#FFFFFF"> 
          <td width="5%" height="22"> 
            <div align="right"><%= Incr + Total_records %>.&nbsp;</div>          </td>
          <td width="9%" height="22"> 
            <div align="center"><b><a href="#"  onClick="return redirect(<%=(EXIREG("SEQNUM"))%>)"><%=(EXIREG("REGNUM"))%></a></b></div>          </td>
          <td width="5%"><%=(EXIREG("USERDEPT"))%></td>
          <td width="13%" height="22"><%=(EXIREG("INVNUM"))%></td>
          <td width="11%" height="22"> 
            <div align="center"><%= (EXIREG("PONUM")) %></div>          </td>
          <td width="11%" height="22"> 
            <div align="center"><%= DoDateTime((EXIREG("PAYMENTDATE")), 2, 2070) %></div>          </td>
          <td width="4%" height="22"> 
            <div align="center"><%=(EXIREG("CURRENCYSYMBOL"))%></div>          </td>
          <td width="10%" height="22"> 
            <div align="right"><%= FormatNumber((EXIREG("INVAMOUNT")), -1, -2, -2, -1) %></div>          </td>
          <td height="22"><%=(EXIREG("VENDORNAME"))%></td>
          <td width="8%" height="22"> 
            <div align="center"><%=(EXIREG("INVSTATUS"))%></div>          </td>
        </tr>
        <% else %>
        <tr bgcolor="#eeeeee"> 
          <td width="5%" height="21"> 
            <div align="right"><%= Incr + Total_records %>.&nbsp;</div>          </td>
          <td width="9%" height="21"> 
            <div align="center"><b><a href="#"  onClick="return redirect(<%=(EXIREG("SEQNUM"))%>)"><%=(EXIREG("REGNUM"))%></a></b></div>          </td>
          <td width="5%"><%=(EXIREG("USERDEPT"))%></td>
          <td width="13%" height="21"><%=(EXIREG("INVNUM"))%></td>
          <td width="11%" height="21"> 
            <div align="center"><%= (EXIREG("PONUM")) %></div>          </td>
          <td width="11%" height="21"> 
            <div align="center"><%= DoDateTime((EXIREG("PAYMENTDATE")), 2, 2070) %></div>          </td>
          <td width="4%" height="21"> 
            <div align="center"><%=(EXIREG("CURRENCYSYMBOL"))%></div>          </td>
          <td width="10%" height="21"> 
            <div align="right"><%= FormatNumber((EXIREG("INVAMOUNT")), -1, -2, -2, -1) %></div>          </td>
          <td height="21"><%=(EXIREG("VENDORNAME"))%></td>
          <td width="8%" height="21"> 
            <div align="center"><%=(EXIREG("INVSTATUS"))%></div>          </td>
        </tr>
        <% end if %>
        <% 
		incr=incr+1
  iRecordsShown = iRecordsShown +1
  EXIREG.MoveNext
loop
%>
      </table>    </td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF">&nbsp; </td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
</table>
</body>
</html>
<%

EXIREG.Close
end if

%>
